package com.jiepu.homework.module5.exercise3;

// 队列
public class Queue {

	private int[] array = new int[1024];
	
	private int size; 
	
	public void in(int n) {
		array[size++] = n;
	}
	
	public int out() {
		// 队列中要出队的元素固定是[0]
		int out = array[0];
		System.arraycopy(array, 1, array, 0, --size);
		return out;
	}
	
}
